<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.12.4.min.js"></script>
    <style>
        .box{
            width: 200px;
            height: 100px;
            background-color: gold;
        }


    </style>
    <script>
        $(function () {
            var $btn = $('#btn');
            var $box = $('.box');

            $btn.click(function fnMove() {
                /*
                animate 参数
                 */
                $box.animate({'width':1000}, 1000, 'swing', function () {
                    $box.animate({'margin-top':400}, 1000, function () {
                        $box.animate({'width':200, 'margin-top':0}, 1000,function () {
                            fnMove();
                        })
                    });
                });

            });
        })
    </script>

</head>
<body>
    <input type="button" value="anime" id="btn">
    <div class="box">这是一个div</div>

</body>
</html>
